using Beaker.OpenCube.Render.Maths;

namespace Beaker.OpenCube.Render.Materials.Brdfs
{
	public sealed class LambertianBrdf
		: Brdf
	{
		private readonly double _reflectionCoefficent;
		private readonly Color _color;

		public LambertianBrdf( double diffuseReflectionCoefficent, Color diffuseColor )
		{
			_reflectionCoefficent = diffuseReflectionCoefficent;
			_color = diffuseColor;
		}

		public override Color F( Intersection intersection, Vector3 wi, Vector3 wo )
		{
			return _reflectionCoefficent * _color * Helpers.InvPI;
		}

		public override Color Rho( Intersection intersection, Vector3 wo )
		{
			return _reflectionCoefficent * _color;
		}
	}
}